home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue63 / Construc / SUnit.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-10-04  |  826 b   |  42 lines

  1. unit SUnit;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   ScktComp;
  6.  
  7. type
  8.   TForm1 = class(TForm)
  9.     ServerSocket1: TServerSocket;
  10.     procedure FormActivate(Sender: TObject);
  11.     procedure ServerSocket1ClientConnect(Sender: TObject;
  12.       Socket: TCustomWinSocket);
  13.   private
  14.     XMLString: String;
  15.   end;
  16.  
  17. var
  18.   Form1: TForm1;
  19.  
  20. implementation
  21. {$R *.DFM}
  22.  
  23. procedure TForm1.FormActivate(Sender: TObject);
  24. var
  25.   F: File;
  26. begin
  27.   System.Assign(F,'table.xml');
  28.   Reset(F,1);
  29.   SetLength(XMLString,FileSize(F));
  30.   BlockRead(F,XMLString[1],FileSize(F));
  31.   System.Close(F)
  32. end;
  33.  
  34. procedure TForm1.ServerSocket1ClientConnect(Sender: TObject;
  35.   Socket: TCustomWinSocket);
  36. begin
  37.   Caption := Caption + '!';
  38.   Socket.SendText(XMLString)
  39. end;
  40.  
  41. end.
  42.